<div class="m-tab s-tab">
	<h2 class="u-tt">会员公告管理</h2>
	<ul>
		<li><a href="{$url|'AdminBulletin/index'}">公告列表</a></li>
		<li class="z-crt"><a href="javascript:;">{$actionName}公告</a></li>
	</ul>
</div>
<div class="m-form">
	<form action="<?php echo url('AdminBulletin/'.$action.'Data'); ?>" method="post" id="form">
		<fieldset>
        	<div class="formitm">
				<label class="lab">发布用户组：</label>
				<div class="ipt">
                <?php 
                    $groupArray = array();
                    if(!empty($info['group_id'])){
                    	$groupArray = explode(',', $info['group_id']);
                    }
                    ?>
                	<label class="u-opt" id="groupAll">
                            <input name="group_id[]" type="checkbox" value="0"   {if="$info['group_id']==0"} checked="checked" {/if} />
							全体</label>
                	<!--{loop="$groupList $key $vo"}-->
                			<label class="u-opt group">
                            <input name="group_id[]" type="checkbox" value="{$vo.group_id}"   {if="in_array($vo['group_id'], $groupArray)"} checked="checked" {/if}/>
							{$vo.name}</label>
					<!--{/loop}-->
                    &nbsp;
					<p>选择发布到的用户组，选择全体后其他用户组选项将无效</p>
				</div>
			</div>
			<div class="formitm">
				<label class="lab">标题：</label>
				<div class="ipt">
					<input name="title" type="text" class="u-ipt u-ipt-5" id="title" value="{$info.title}" maxlength="100" datatype="s" />
					<p>会员公告标题最多250个字符</p>
				</div>
			</div>
            <div class="formitm">
				<label class="lab">内容：</label>
				<div class="ipt">
					<textarea name="content" id="content" class="u-editor" style="width:100%;height:400px;visibility:hidden;">{$info.content}</textarea>
				</div>
			</div>
            <div class="formitm">
					<label class="lab" >发布时间：</label>
					<div class="ipt">
						<input name="time" type="text" class="u-ipt u-ipt-6 u-time" id="time" value="<?php if(empty($info['time'])){ echo date('Y-m-d H:i:s'); }else{ echo date('Y-m-d H:i:s',$info['time']); } ?>" maxlength="250" readonly="readonly" datatype="*" errormsg="更新时间不能为空！"   />
						<p>内容最后的更新时间</p>
					</div>
				</div>
			<div class="formitm">
					<label class="lab" >状态：</label>
					<div class="ipt">
						<?php if(!isset($info['status'])){ $info['status']=1; } ?>
						<label class="u-opt">
							<input name="status" type="radio" value="1" {if="$info['status']==1"} checked="checked" {/if} />
							正常</label>
						<label class="u-opt">
							<input name="status" type="radio" value="0" {if="$info['status']==0"} checked="checked" {/if} />
							草稿</label>
					</div>
				</div>
			<div class="formitm formitm-1  formitm-2">
				<input name="bull_id" type="hidden" value="{$info.bull_id}" />
				<button class="u-btn" type="submit">保存</button>
				<button class="u-btn s-btn-c3" type="reset">重置</button>
				<span class="status" id="status"></span> </div>
		</fieldset>
	</form>
</div>
<script>
Do.ready('base','form','dialog','editor','upload','calendar',function() {
	//表单综合处理
	$('#form').duxFormPage({returnUrl:'{$url|"AdminBulletin/index"}'});
	//处理选择
	$('#groupAll').find('input').click(function() {
		if($(this).attr("checked")){
			$('.group').find('input').removeAttr("checked");
		}
    });
	$('.group').find('input').click(function() {
		if($(this).attr("checked")){
			$('#groupAll').find('input').removeAttr("checked");
		}
	});
});
</script>